package huawei;


import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by wanghongfu on 17/5/26.
 * email  1583505981@qq.com
 */
public class  ArraySplit{
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int len=in.nextInt();
        int[]  arr=new int[len];
        for (int i=0;i<len;i++){
            arr[i]=in.nextInt();
        }
        int splitnum=0;
        int i=0;
        for (;i<arr.length-1;){
            if (arr[i]<arr[i+1]){
                i=incIndex(arr,i);
                System.out.println(i);
                splitnum++;
                i++;
            }
            if (arr[i]==arr[i+1]){
                System.out.println(i);
                i=i+1;
            }
            if (arr[i]>arr[i+1]){
                i=redIndex(arr,i);
                System.out.println(i);
                splitnum++;
                i++;
            }
        }
        if (splitnum==0) {
            System.out.println(1);
        }else{ 
            System.out.println(splitnum);     
        }
    }
    private static int incIndex(int[] arr,int index){
        for (;index<arr.length-1;index++){
            if (arr[index]>=arr[index+1]){
                return index;
            }
        }
        return 0;
    }

    private static int redIndex(int[]arr,int index){
        for (;index<arr.length-1;index++){
            if (arr[index]<=arr[index+1]){
                return index;
            }
        }
        return 0;
    }
}

